﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using LCTNote.Models.ViewModels;
using LCTNote.Models.DataModels;
using LCTNote.Services;

namespace LCTNote.Business
{
    static class NguoiDungBusiness
    {        
        public static bool kiemTraDangNhap(string tenDangNhap, string matKhau)
        {
            NguoiDungDataModel nguoiDung = new NguoiDungDataModel();
            nguoiDung.matKhau = NguoiDungService.layMatKhauTheoTaiKhoan(tenDangNhap);

            if (nguoiDung.matKhau == matKhau)           
                    return true;            
                return false;
        }

        public static bool themNguoiDung(NguoiDungDataModel nguoiDung)
        {
            return NguoiDungService.themNguoiDung(nguoiDung);
        }

        public static NguoiDungViewModel layNguoiDungTheoMa(int ma)
        {
            return NguoiDungService.layNguoiDungTheoMa(ma);
        }

        public static NguoiDungViewModel layNguoiDungTheoTenDangNhap(string tenDangNhap)
        {
            return NguoiDungService.layNguoiDungTheoTenDangNhap(tenDangNhap);
        }
    }
}
